var status = -1;
var itemList = Array(Array(5000217, 5, 2, 0), Array(1802354, 0, 1, 0));

function start() {
    var b = Math.floor(Math.random() * 10);
    var a = Array();
    for (var c = 0; c < itemList.length; c++) {
        if (itemList[c][1] >= b) {
            a.push(itemList[c])
        }
    }
    if (a.length != 0) {
        im.removeItem(2430690);
        var e = new java.util.Random();
        var d = e.nextInt(a.length);
        var h = a[d][0];
        var g = a[d][2];
        var f = a[d][3];
        im.gainItem(h, g)
    }
    im.dispose()
};